package live.pay;

import java.util.Date;
import java.util.Map;
import java.util.TreeMap;

import live.api.impl.PaySendReqRes;
import live.common.Format;
import live.common.GetSequence;
import live.common.PostParam;
import live.response.WebServicePay;


public class OrderQuery {
	PaySendReqRes psr = null;
	/**
	 * 一卡通单笔对账
	 * @param map
	 * @param notifyUrl
	 */
	@SuppressWarnings("unchecked")
	public void cardRecon(Map map , String notifyUrl){
		Map reconMap = new TreeMap();
		reconMap.put("service_id", "130001");
		reconMap.put("req_org_cd", map.get("req_org_cd").toString().trim());
		reconMap.put("req_trans_tm", Format.getInstance().dateFormatString(new Date(), "yyyyMMddHHmmss").trim());
		reconMap.put("req_trans_seq", GetSequence.returnSeqNum().trim());
		reconMap.put("order_id", map.get("order_id").toString().trim());
		reconMap.put("notify_url", notifyUrl);
		reconMap.put("original_service_id", map.get("service_id").toString().trim());
		reconMap.put("original_trans_seq", map.get("req_trans_seq").toString().trim());
		String sign = SignUtil.sign(reconMap, PostParam.PAYKEY);
		reconMap.put("sign", sign);
		reconMap.put("sign_type", "MD5");
		map.put("service_id", "130001");
		map.put("order_desc", "订单号【"+map.get("order_id")+"】,流水号【"+map.get("req_trans_seq")+"】单笔对账");
		map.put("sign", sign);
		map.put("req_trans_tm", reconMap.get("req_trans_tm"));
		map.put("req_trans_seq", reconMap.get("req_trans_seq"));
		map.put("notify_url", notifyUrl);
		psr = new PaySendReqRes();
		psr.insertSendRequest(map);
		new WebServicePay().pixNull(PostParam.RECON, reconMap);
	}
}
